home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Multimedia / Resource Library: Multimedia.iso / maestro / source / videbjct / cvd1000d.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-15  |  5.7 KB  |  173 lines

  1. /*
  2.  * Copyright (c) 1992 Stanford University
  3.  *
  4.  * Permission to use, copy, modify, and distribute this software and 
  5.  * its documentation for any purpose is hereby granted without fee, provided
  6.  * that (i) the above copyright notices and this permission notice appear in
  7.  * all copies of the software and related documentation, and (ii) the name
  8.  * Stanford may not be used in any advertising or publicity relating to
  9.  * the software without the specific, prior written permission of
  10.  * Stanford.
  11.  * 
  12.  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
  13.  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
  14.  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
  15.  *
  16.  * IN NO EVENT SHALL STANFORD BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
  17.  * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES
  18.  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT
  19.  * ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY,
  20.  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  21.  * SOFTWARE.
  22.  */
  23.  
  24. /* $Header: /Source/Media/collab/VideoObject/RCS/CVD1000Driver.h,v 1.23 92/09/04 14:34:08 drapeau Exp $ */
  25. /* $Log:    CVD1000Driver.h,v $
  26.  * Revision 1.23  92/09/04  14:34:08  drapeau
  27.  * Added a few defined constants for functions "SearchIsInProgress()" and
  28.  * EditIsInProgress(), used by the RecordFromTo() method.
  29.  * Also, added function definitions for these new functions.
  30.  * Also, changed function definitions for a few newly-renamed functions that
  31.  * now reflect the correct naming scheme for the CVD1000 module.
  32.  * 
  33.  * Revision 1.22  92/09/01  16:56:48  drapeau
  34.  * Cosmetic changes to function definitions to make the code easier to read.
  35.  * 
  36.  * Revision 1.21  92/08/25  16:27:24  drapeau
  37.  * Made a couple of changes:
  38.  * * Added function prototypes to function declarations for better ANSI
  39.  *   compliance and ease of debugging.
  40.  * * Added definitions for a few new functions used internally by the
  41.  *   CVD1000 driver.
  42.  * 
  43.  * Revision 1.2  92/08/05  16:18:08  drapeau
  44.  * Replaced octal valuas with equivalent hex values, to simplify
  45.  * the task of reading the code.
  46.  * 
  47.  * Revision 1.1  92/06/17  01:01:03  drapeau
  48.  * Changed termio usage, used more portable "termio" structure and
  49.  * associated calls instead of "termios".
  50.  * 
  51.  * Revision 1.0  92/06/17  00:19:52  drapeau
  52.  * Initial revision
  53.  *  */
  54.  
  55. static char cvdHeaderRcsid[] = "$Header: /Source/Media/collab/VideoObject/RCS/CVD1000Driver.h,v 1.23 92/09/04 14:34:08 drapeau Exp $";
  56.  
  57. #include <errno.h>
  58. #include <stdio.h>
  59. #include <sys/param.h>
  60. #include <sys/types.h>
  61. #include <sys/time.h>
  62. #include <sys/stat.h>
  63. #include <sys/termio.h>
  64. #include <sys/file.h>
  65. #include "videoObj.h"
  66. #include "PlayerStatus.h"
  67.  
  68. /* Packet header */
  69. #define Header    '\x81'                        /* Header has destination address = 1, non-broadcast */
  70. #define RcvHeader '\x90'
  71.  
  72. /* Message header */
  73. #define Command1 '\x01'
  74. #define Command2 '\x02'
  75. #define Command3 '\x03'
  76. #define Command4 '\x04'
  77. #define Inq      '\x09'
  78. #define Address  '\x30'
  79.  
  80. /* Message categories */
  81. #define Interface '\x00'
  82. #define Vcr       '\x02'
  83. #define Effects   '\x03'
  84.  
  85. /* VCR modes */
  86. #define CVDPower  '\x00'
  87. #define Mode1     '\x01'
  88. #define Mode2     '\x02'
  89. #define Search    '\x03'
  90. #define EditCtrl  '\x05'
  91. #define Transport '\x0A'
  92. #define SubCtrl   '\x10'
  93. #define Media     '\x12'
  94. #define OSD       '\x15'
  95.  
  96. /* Counter Types */
  97. #define TimeCode    '\x21'
  98. #define ChapterCode '\x31'
  99. #define IndexCode   '\x32'
  100.  
  101. /* Packet terminator */
  102. #define Terminator '\xFF'
  103.  
  104. /* Reply */
  105. #define CVDAck      1
  106. #define Completion  2
  107. #define CVDError    3
  108. #define Unknown     -1
  109. #define CompletionSize 3
  110.  
  111. /* Masks */
  112. #define SocketMask           '\x0F'
  113. #define ReplyMask            '\xF0'
  114. #define ErrorCatMask         '\xF0'
  115. #define ErrorNumMask         '\x0F'
  116. #define UpperMask            '\xF0'
  117. #define LowerMask            '\x0F'
  118. #define SearchInProgressMask    '\x02'
  119. #define EditInProgressMask    '\x04'
  120.  
  121.  
  122. typedef struct _OutCommand
  123. {
  124.   int socketNum;
  125.   struct _OutCommand* next;
  126. } OutCommand;
  127.  
  128. /* CVD1000 status */
  129. #define CVD1000StopTapeTop       100
  130. #define CVD1000StopTapeEnd       101
  131. #define CVD1000StopEmergency     102
  132. #define CVD1000ForwardSlow2      103
  133. #define CVD1000ForwardSlow1      104
  134. #define CVD1000ForwardFast1      105
  135. #define CVD1000ReverseSlow2      106
  136. #define CVD1000ReverseSlow1      107
  137. #define CVD1000ReverseFast1      108
  138.  
  139. int CVD1000Play            (VideoObject*);
  140. int CVD1000PlayFromTo        (VideoObject*, int, int, int);
  141. int CVD1000FastForward        (VideoObject*);
  142. int CVD1000Reverse        (VideoObject*);
  143. int CVD1000CalcSpeed        (VideoObject*, int, int);
  144. int CVD1000PlayAtSpeedDir    (VideoObject*, int, enum Direction);
  145. int CVD1000Step            (VideoObject*, enum Direction);
  146. int CVD1000Still        (VideoObject*);
  147. int CVD1000Stop            (VideoObject*);
  148. int CVD1000SetDefaults        (VideoObject*, int, int, int, int);
  149. int CVD1000SetAudio        (VideoObject*, int);
  150. int CVD1000SetVideo        (VideoObject*, int);
  151. int CVD1000SetAddMode        (VideoObject*, int);
  152. int CVD1000SetAddressDisplay    (VideoObject*, int, int);
  153. int CVD1000Eject        (VideoObject*);
  154. int CVD1000Power        (VideoObject*, int);
  155. int CVD1000QueryFrame        (VideoObject*);
  156. int CVD1000QueryChapter        (VideoObject*);
  157. int CVD1000QueryAudio        (VideoObject*);
  158. int CVD1000QueryVideo        (VideoObject*);
  159. int CVD1000QueryMedium        (VideoObject*, char*);
  160. int CVD1000QueryStatus        (VideoObject*);
  161. int CVD1000Ping            (VideoObject*);
  162. int CVD1000Record        (VideoObject*);
  163. int CVD1000RecordFromTo        (VideoObject*, int, int, int);
  164.  
  165. void CVD1000PrintErrorMessage    (int, int);
  166. int CVD1000SendCode        (VideoObject*, char, char, char*, int, int);
  167. int CVD1000ReadInquiryReply    (VideoObject*, int);
  168. int CVD1000ReadReply        (VideoObject*);
  169. int CVD1000InputPending        (int);
  170. int CVD1000WaitForCompletion    (VideoObject*);
  171. int CVD1000SearchIsInProgress    (VideoObject*);
  172. int CVD1000EditIsInProgress    (VideoObject*);
  173.